﻿using ACS.SPiiPlusNET;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Company.Axis
{
    public class PositioningAxisState : BindableBase
    {
        #region 字段
        private bool _Moving;

        private bool _Accelerating;

        private bool _Faulted;

        private bool _InPosition;

        private bool _Referenced;

        private bool _Enabled;

        private bool _IsSoftwareLimitActivated;

        private bool _IsHardwareLimitActivated;

        private MotorStates _MotorStates;

        private ProgramStates _ProgramStates;

        private SafetyControlMasks _MotorSafetyControlMasks;

        private int _MotorErrorId;

        private string _MotorErrorMessage;
        #endregion
        #region 属性
        public bool Enabled
        {
            get { return _Enabled; }
            set { _Enabled = value; RaisePropertyChanged(); }
        }

        public bool Referenced
        {
            get { return _Referenced; }
            set { _Referenced = value; RaisePropertyChanged(); }
        }

        public bool InPosition
        {
            get { return _InPosition; }
            set { _InPosition = value; RaisePropertyChanged(); }
        }

        public bool Faulted
        {
            get
            {
                return _Faulted;
            }
            set { _Faulted = value; RaisePropertyChanged(); }
        }

        public bool Accelerating
        {
            get { return _Accelerating; }
            set { _Accelerating = value; RaisePropertyChanged(); }
        }

        public bool Moving
        {
            get { return _Moving; }
            set { _Moving = value; RaisePropertyChanged(); }
        }

        public MotorStates MotorStates
        {
            get { return _MotorStates; }
            set { _MotorStates = value; RaisePropertyChanged(); }
        }

        public ProgramStates ProgramStates
        {
            get { return _ProgramStates; }
            set { _ProgramStates = value; RaisePropertyChanged(); }
        }
        /// <summary>
        /// 软限位激活
        /// </summary>
        public bool IsSoftwareLimitActivated
        {
            get { return _IsSoftwareLimitActivated; }
            set { _IsSoftwareLimitActivated = value; RaisePropertyChanged(); }
        }
        public bool IsHardwareLimitActivated
        {
            get { return _IsHardwareLimitActivated; }
            set { _IsHardwareLimitActivated = value; RaisePropertyChanged(); }
        }
        public SafetyControlMasks MotorSafetyControlMasks
        {
            get { return _MotorSafetyControlMasks; }
            set { _MotorSafetyControlMasks = value; RaisePropertyChanged(); }
        }

        public int MotorErrorId
        {
            get { return _MotorErrorId; }
            set { _MotorErrorId = value; RaisePropertyChanged(); }
        }

        public string MotorErrorMessage
        {
            get { return _MotorErrorMessage; }
            set { _MotorErrorMessage = value; RaisePropertyChanged(); }
        }
        #endregion
    }
}
